import request from '@/utils/request'

/**
 * 新增影片
 * @param data
 * @returns {*}
 */
export function addFilm(data) {
  return request({
    url: '/ticket-film/api/v1/fms/film',
    method: 'post',
    data: data
  })
}

/**
 * 更新影片
 * @param data
 * @returns {*}
 */
export function updateFilm(data) {
  return request({
    url: '/ticket-film/api/v1/fms/film',
    method: 'put',
    data: data
  })
}

/**
 * 下架影片
 * @param filmId
 * @returns {*}
 */
export function deleteFilm(filmId) {
  return request({
    url: '/ticket-film/api/v1/fms/film?filmId='+filmId,
    method: 'delete'
  })
}

/**
 * 上映
 * @param filmId
 * @returns {*}
 */
export function releaseFilm(filmId) {
  return request({
    url: '/ticket-film/api/v1/fms/film/release?filmId='+filmId,
    method: 'put'
  })
}

/**
 * 设置影片状态为未上映
 * @param filmId
 * @returns {*}
 */
export function unReleaseFilm(filmId) {
  return request({
    url: '/ticket-film/api/v1/fms/film/un-release?filmId='+filmId,
    method: 'put'
  })
}
